package com.netstar.property;

import java.util.HashMap;

public class ServerError extends Property {

	private static final long serialVersionUID = 3409505753571442292L;

	public static final String CLASS_NAME = "ServerError";

	private static final String ERROR_DETAIL = "err_detail";

	/**
	 * The error detail from server.
	 */
	public String errorDetail;

	public static PropertyClass getPropertyClass() {
		PropertyClass klass = new PropertyClass(ServerError.class, CLASS_NAME) {
			@Override
			public Property factory() {
				return new ServerError();
			}
		};

		final HashMap<String, AbstractProperty> props = klass.properties;
		props.put(ERROR_DETAIL, new StringProperty() {

			@Override
			public void set(Property obj, String val) {
				((ServerError) obj).errorDetail = val;
			}

			@Override
			public String get(Property obj) {
				return ((ServerError) obj).errorDetail;
			}
		});

		return klass;
	}
}
